home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-17 | 8.8 KB | 240 lines | [TEXT/MPS ] |
- #
- # ****************************************************************************
- #
- # File Name: QuarkXpress.vu
- #
- # Contains: Quick look test script for QuarkXPress version 3.11
- #
- # Written by: Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
- #
- # Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
- #
- # ****************************************************************************
- # C h a n g e H i s t o r y (most recent first):
- # ****************************************************************************
- #
- # Vers Date Author Description
- # ---- -------- ------ ---------------------------------------------
- # <1.0.6> 9/30/93 KTA Initialize gFileName prior to gApptitle being updated by
- # launchTwitch().
- # <1.0.5> 9/28/93 KTA Added returnVal for ModifyDocument hook.
- # <1.0.2> 6/16/93 NAGA Renaming InitGlobals(ScriptLevel)to InitGlobals(ScriptLevel)
- # <1+> 5/25/93 NAGA Adding header and porting old files to follow new standards
- #
- # ****************************************************************************
- #
-
-
-
- ########################################################################
- # External libraries
- #=======================================================================
- Libraries "Output.Lib", "DoTasks.Lib","Draw.Lib","UserInterface.Lib","DA.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib";
-
-
- #########################################################################
- ######## Application Specific Tasks
- #########################################################################
-
- #########################################################################
- # InitAppGlobals()
- #========================================================================
- # Author: ML
- # Description: Sets up tools and fonts for QuarkXPress. This task
- # must be called first.
- # Parameters: None
- # Returns: Nothing
- # Examples: InitAppGlobals()
- #========================================================================
- # History:
- #
- ########################################################################
- task InitAppGlobals()
- begin
-
- logstr("setting up {global gApptitle}'s globals");
- global kClick, kDrag, kDragClick, kMultiDrag, kMultiClickDrag, kMultiClick;
- global kPalDocWind, kPalWind, kPullOffPal, kPopUpPal, kScrollPal;
- global kToolPaletteNum := 1;
- global kLinePaletteNum := 0;
- global kPatternPaletteNum := 0;
- global kColorPaletteNum := 0;
-
- global gLineWeights := {};# This is used for menuItems
-
- global gWindowInset := {20,40,20,20}; # Window inset
- global gScreenInset := {30,20,0,0}; # Screen inset
- global gVoidRect := {}; # Rect not to draw in - coordinates should be RelativeToWindow
- global gTextStr;
- global gDocumentWindow := 0; # only used in Freehand at this point;
-
- global gPaletteList := {
- { #### Start Palette #1 - Tools
- {1,14}, # List := {Specifier for Palette window ("String" if TITLE, integer if ORD), Header height}.
- kPalWind, # Palette type
- {1,13}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {0,18} # Offset between tools {h,v}
- } #### End Palette #1
- };
-
-
- ### QuarkXpress {Flag, Pattern, Line, Color}
- ### Palette Elements:= Tool#, Pal#, ToolName, ToolType, DblClktoEnd SetAttributes
- global PageShift := { 1, 1, "PageShift", kDrag, 0, {0}};
- global ContentTool := { 2, 1, "ContentTool", kMultiDrag, 0, {0}};
- global PageRotate := { 3, 1, "PageRotate", kDrag, 0, {0}};
- global ZoomTool := { 4, 1, "Zoom", kClick, 0, {0}};
-
- global TextBoxTool := { 5, 1, "TextBox", kDrag, 0, {0}};
- global RectTool := { 6, 1, "Rect", kDrag, 0, {0}};
- global RndRectTool := { 7, 1, "RndRect", kDrag, 0, {0}};
- global OvalTool := { 8, 1, "Oval", kDrag, 0, {0}};
-
- global MultiPoint := { 9, 1, "MultiPoint", kMultiClick,1, {0}};
- global StraightLine := { 10, 1, "StraightLine", kDrag, 0, {0}};
- global LineTool := { 11, 1, "Line", kDrag, 0, {0}};
- global LinkTool := { 12, 1, "Link", kClick, 0, {0}};
- global UnLinkTool := { 13, 1, "UnLink", kClick, 0, {0}};
-
-
-
- # global Tool list
- global gToolList:={ #PageShift,
- ContentTool,
- PageRotate,
- ZoomTool,
-
- TextBoxTool,
- RectTool,
- RndRectTool,
- OvalTool,
-
- MultiPoint,
- StraightLine,
- LineTool
- #LinkTool,
- #UnLinkTool
- };
-
- ### font characteristic lists
- global gFontSizeList := {'7','9','10','12','14','18', '24','36','48','60','72'};
- global gFontStyleList := {"Bold","Italic","Underline","Strikethru","Outline","Shadow"};
-
- ### Name of the Plain (style) menu item ####
- global gPlainStyle := "Plain"; # Plain-Style menu item
-
- ### How to get to the next line
- global gNextLineMethod := 1;
- ### 1 - ReturnKey, 2 - EnterKey, 3 - DownArrow Key, 4 - TabKey, {} - Move/Click, {'Untitled'} - Move relative to the window titled 'Untitled' /Click
-
- ### Does moving to the next line clear all font info
- global gNextLineClearsFontSettings := 0;
-
- ### Set DoWindows to skip scrolling, scroll bars not recognized
- global gDoWindowList:= {1,0,1,1};
-
- end; # InitAppGlobals
-
- #########################################################################
- # QuarkScrapText()
- #========================================================================
- # Author: ML
- # Description: Paste text into QuarkXpress Document
- # Parameters: None
- # Returns: Nothing
- # Examples: QuarkScrapText();
- # Assumptions: None
- # Applications: QuarkXpress
- #========================================================================
- # History:
- #
- #########################################################################
- task QuarkScrapText()
- begin
- global kScrapTEXT;
- # Text from Scrap
- logstr("Setting up for Scraptext");
- Draw(global TextBoxTool);
- return(ScrapBook(kScrapTEXT));
- end;
-
- #########################################################################
- # QuarkScrapPict()
- #========================================================================
- # Author: ML
- # Description: Paste pict into QuarkXpress Document
- # Parameters: None
- # Returns: Nothing
- # Examples: QuarkScrapPict();
- # Assumptions: None
- # Applications: QuarkXpress
- #========================================================================
- # History:
- #
- #########################################################################
- task QuarkScrapPict()
- begin
- global kScrapPICT;
- # Pict From Scrap
- logstr("Setting up for ScrapPict");
- Draw(global RectTool);
- ScrapBook(kScrapPict);
- end;
-
- #########################################################################
- # DoTextQuarkXpress()
- #========================================================================
- # Author: KTA
- # Description: Test Text.
- # Parameters: None
- # Returns: Nada
- # Examples: DoTextQuarkXpress();
- # Assumptions: QuarkXpress
- #========================================================================
- # History:
- #
- #########################################################################
- task DoTextQuarkXpress()
- begin
- ### Vu error when selecting Font MenuItems - Can't find exposed part to select
- logstr("Setting up to type text");
- DrawObject({global TextBoxTool,{{106,100},{534,389}},0,0,0});
- wait(3);
- # DoText(); # Vu error when selecting Font MenuItems - Can't find exposed part to select
- TypeStr(global gTextStr);
- end;
-
- ################################################################################
- #################### Main script ####################
- ################################################################################
- script QuarkXpress (ScriptLevel:= -1)
- begin
- InitGlobals(ScriptLevel); # initialize your general globals
- InitDraw();
- InitFonts();
- Global gApptitle := "QuarkXpress";
- global gAppVersion := '3'; # version of app you will be running
- global gFileName := "@!@-{gBuildVers}-{gAppTitle}"; # This is used in SaveAs when saving files
- SuiteStart('QuarkXpress.vu'); # begin a new test suite
- if LaunchTwitch("{gAppTitle}",gAliasDirectory) # launch or twitch to your app
- begin
- global gCustomScrapText:= task QuarkScrapText; # define app specific task
- global gCustomScrapPict:= task QuarkScrapPict; # define app specific task
- global gModifyDocument:= task QuarkScrapText; # define app specific task
- InitAppGlobals(); # init app specific globals
- (*
- *)
- DoSetUpApp(1,-1,,"OK",1,1); # No Default window
- DoDraw();
- DoTextQuarkXpress();
- DoWindow();
- DoCloseApp(1);
- LogStr("############################# LIMITATIONS: ############################");
- LogStr("NOTE: Vu error when selecting Font MenuItems, so DoText not done.");
- end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
- SuiteEnd();
- end; # script QuarkXpress
-
- ### What's Needed
- # 2) Possibly close the toolbox before starting Window tests.
- # 3) Content Tool and Textbox tool could be gTextStr tools if necessary.